1. Field of Invention
The present invention relates generally to methods, software, and apparatus for discovering and activating software components for use with a software application.
More particularly, the present invention relates to methods, software, and apparatus for associating data with a component such that an application which is arranged to present the data may do so through the use of the component, without directly specifying the component to be used.
2. Background
A computer software application typically has access to one or more software components, e.g., viewers, which the software application may use to present and to manipulate data. By way of example, a file manager application may use an editor which enables the data in a file to be viewed and edited, while an electronic mail application may use a viewer which enables attachments sent with mail messages to be viewed.
In general, a computer system will include numerous different applications which are arranged to manipulate data. In some cases, different applications may be arranged to manipulate the same types of data, e.g., text data, audio data, or image data. Therefore, different applications may utilize substantially the same software components, or command objects. Maintaining separate command objects which serve the same purpose, but are associated with different applications, enables data to be presented and manipulated by the applications. However, the maintenance of separate command objects for each application consumes many system resources, e.g., storage resources, and is, as a result, inefficient. The maintenance of separate command objects for each application is further inefficient in that command objects which serve substantially the same purpose may not be reused by different applications and, hence, must generally be rewritten for each application.
In order to take advantage of the fact that common command objects are often used by different applications, a set of command objects may generally be made available to substantially all of the applications associated with an overall computer system, e.g., a computer network. That is, a set of command objects that are arranged to be used by numerous applications may be provided. When an application is arranged to utilize a set of command objects that are used by numerous applications, the application is commonly xe2x80x9cdirectlyxe2x80x9d associated with any command objects the application may use. Such a direct association involves providing the application with identifiers for the command objects which are used by the application to bind, or pair, data with a suitable command object. The command object is then used to present and to manipulate the data that is paired with the command object. By way of example, a file manager application, which accesses file data, is provided with identifiers for text viewers which are suitable for use in viewing file data.
As computer systems and, therefore, applications are becoming more advanced, the types of data which may be manipulated by different applications, as well as the command objects used by applications to manipulate data, often change, e.g., an electronic mail application which previously accepted only text attachments may be expected to also accept image attachments. However, using a framework which involves directly associating an application with a set of command objects that are available to the application does not facilitate the inclusion of new command objects. In other words, when it is desired for an application to be able to bind data with a new command object, and to utilize the new command object, the new command object must somehow be directly associated with the application. As such, the addition of new command objects often requires that applications be modified to recognize the new command objects.
The process of directly associating new command objects with applications is inefficient, as the process typically involves reconfiguring at least portions of the applications such that the applications recognize the new command objects and, further, serve to associate data with the new command objects. By way of example, a look-up table used by the application to associate data with command objects must be modified to include any new command objects which the application may use.
Therefore, what is desired is an efficient method for binding data with suitable command objects such that an application which executes the command object is impervious to the binding process. In other words, a framework which enables data that is associated with an application to be paired with an appropriate command object, substantially without involving the application, is desired.
To achieve the foregoing and in accordance with the purpose of the present invention, methods, software, and apparatus for transparently pairing data with a command object, with respect to the application which wishes to present the data, are disclosed. In one aspect of the present invention, a computer-implemented framework for associating data with a command object includes a data handler mechanism arranged to interface with an application which wishes to use the data. The framework also includes a data retriever mechanism that is arranged to obtain the data, and is in communication with the data handler mechanism. A mapping mechanism, which is also in communication with the data handler mechanism, is arranged to obtain the command object.
In one embodiment of the present invention, the data is a stream of bytes, and the data handler mechanism is used to bind the stream of bytes to the command object. In another embodiment, the data retriever mechanism includes a data content handler mechanism that is also in communication with the data handler mechanism. The data content handler mechanism is arranged to convert data into a data object which may be created using the Java(trademark) programming language.
In accordance with another aspect of the present invention, a computer-implemented method for associating data with a command object in response to a request from an application involves accessing the data through an interface that processes requests from the application, and accessing a mapping mechanism which is in communication with the interface. The mapping mechanism, which is accessed by the interface, is arranged to locate a command object that is appropriate for the data. The method for associating data with a command object also involves using the mapping mechanism to obtain the command object that is appropriate for the data, to bind the command object to the data, and to return the command object to the application through the interface.
In one embodiment, the data is a data object that is created by a content handler mechanism which is accessed by the data handler. The content handler mechanism is arranged to create a data object from a stream of bytes. In another embodiment, the data is a stream of bytes, and accessing the data through the interface involves accessing a data retriever which is arranged to obtain the data.